export default function myajax(url, parameters)
{
    return new Promise((resolve) => {
        axios
            .post(url, parameters,{withCredentials: true})
            .then(result => {
                if (result.data.code == "001")
                // 请求成功时
                {
                    resolve(result.data.data);
                    alert("登录成功！");
                    // location.assign("http://localhost:8088/homepage");
                    location.href="http://localhost:8088/homepage?"+result.data.data.dealerId;
                }
                else {
                    alert("登录失败，请检查用户名和密码是否输入正确");
                }
            })
    });
}